package fr.afcepf.vod.metier;

import java.util.Set;

import javax.inject.Inject;
import javax.inject.Named;

import fr.afcepf.vod.dao.IDaoDescription;
import fr.afcepf.vod.dao.IDaoTag;
import fr.afcepf.vod.entities.Description;

@Named
public class GestionDescriptionImpl implements IGestionDescription {
	
	private IDaoDescription daoDescription;
	private IDaoTag daoTag;


	@Inject
	public void setDaoDescription(IDaoDescription daoDescription) {
		this.daoDescription = daoDescription;
	}

	
	public IDaoTag getDaoTag() {
		return daoTag;
	}


	@Inject
	public void setDaoTag(IDaoTag daoTag) {
		this.daoTag = daoTag;
	}


	public IDaoDescription getDaoDescription() {
		return daoDescription;
	}


	@Override
	public void ajouterDescription(Description d) {
		daoDescription.ajouterDescription(d);
		daoTag.associerTagDescription(d);
		
	}

	@Override
	public void supprimerDescription(Description d) {
		daoDescription.supprimerDescription(d);
		
	}

	@Override
	public void modifierDescription(Description d) {
		daoDescription.modifierDescription(d);
		
	}


	@Override
	public Set<Description> getListDescriptions() {
		return daoDescription.listerDescriptions();
		 
	}


	@Override
	public void relierDescriptionAuPere(Description d, Description pere) {
		ajouterDescription(d);
		daoDescription.relierDescriptionAuPere(d, pere);
	}



}
